<template>
  <el-select v-model="value" placeholder="请选择用户">
    <el-option v-for="item in users" :key="item.id" :label="item.userName" :value="item.id" />
  </el-select>
</template>
<script setup lang="ts">
import { ref, onMounted, defineModel } from 'vue';
import { ElSelect } from 'element-plus';
import { getUsersAsync } from '@/utils/api/user/index';
import type { SearchUserListInputDto, SearchUserOutputDto } from '@/utils/api/user/type';
const users = ref<Array<SearchUserOutputDto>>([]);
const value = defineModel<string>();
onMounted(async () => {
  const search: SearchUserListInputDto = {
    maxResultCount: 999
  };
  const res = await getUsersAsync(search);
  users.value = res;
});
</script>

<style lang="scss" scoped></style>
